home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3130 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.5 KB  |  56 lines

  1. Newsgroups: comp.lang.c++
  2. Path: news.sprintlink.net!mv!usenet
  3. From: ENGR@GSSI.MV.COM (Michael Furman)
  4. Subject: Re: A question about declaring/passing arrays of structures
  5. Distribution: na
  6. Message-ID: <DLCJpw.66G@mv.mv.com>
  7. Mime-Version: 1.0
  8. Organization: GSSI
  9. Date: Wed, 17 Jan 1996 22:27:30 GMT
  10. References: <4djhdc$kp3@kira.cc.uakron.edu>
  11. X-Newsreader: WinVN 0.93.10
  12. X-Nntp-Posting-Host: gssi.mv.com
  13.  
  14. In article <4djhdc$kp3@kira.cc.uakron.edu>, tberg@dax.cc.uakron.edu says...
  15. >
  16. >     I have recently been having trouble getting a program to work.  It
  17. >consists of 6 variables, which are all arrays of structures.  It seems
  18. >that when I pass them to a function, (located in another file), the
  19. >compiler will flag a fatal error on some of them.  They are all defined
  20. >properly in a '.h' file, and linked to from the main program file,
  21. >(containing the 'main' function).  There is nothing really unique about
  22. >the functions that work.  Most of them consist of a few character
  23. >variables, a few integers, and 5 of the 6 contain a character array, set
  24. >to a certain length by a constant.
  25. >     The error that I get is a 'General Protection Error' at 0001:3???,
  26. >which seems low in memory.  But, when I comment out a for-next loop
  27. >that is immediately after the function call, I get a 'Stack Fault' error
  28. >at ALMOST the same location.  I'm baffled.  I've had assembler, and
  29. >several programming courses, but this one puzzles me.
  30. >     Does anybody have a possible solution?  If so, e-mail PERSONALLY,
  31. >as I don't get to read the news often.  Your help is VERY MUCH
  32. >appreciated, as I have been trying to remedy this problem for almost 4
  33. >months now, with no success!!
  34.  
  35. It looks like your program just have a bug. More likely your are accesing
  36. some data using non initialized pointer or accessing array with wrong
  37. index value. Nobody can help you because you did not post your source
  38. code. If program is short you can post it - there is a chance that 
  39. sombody will find what is wrong. 
  40.   But I would recommend you to find it yourself. Just use debugger, go thru
  41. program and check what it is doing.
  42.  
  43. >
  44. >Tim Berg
  45. >
  46.  
  47. -- 
  48. <<<<<<<< This is a copy of post to the newsgroup >>>>>>>>
  49. ---------------------------------------------------------------
  50. Michael Furman,                       (603)893-1109
  51. Geophysical Survey Systems, Inc.  fax:(603)889-3984
  52. 13 Klein Drive - P.O. Box 97          engr@gssi.mv.com 
  53. North Salem, NH 03073-0097            71543.1334@compuserve.com
  54. ---------------------------------------------------------------
  55.  
  56.